package org.jeecg.modules.demo.yhs.Controller;

import org.jeecg.modules.demo.yhs.POJO.ConHistory;
import org.jeecg.modules.demo.yhs.POJO.Result;
import org.jeecg.modules.demo.yhs.Service.ConsumerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/Y")
public class ConsumerController {

    @Autowired
    private ConsumerService consumerService;

    @GetMapping(value = "/consumer",produces = "application/json; charset=utf-8")
    public Result ss(){
        List<ConHistory> list=consumerService.findLastTwo();
        return new Result(200,"success",list);
    }
}
